package com.dense.kuiniu.shelfcard.utils.search;

import java.util.List;

/**
 * @author Administrator
 * @date 2020/8/20
 */
public class SearchUtils {
    public static int search(String searchKey, List<? extends SearchAble> list) {
        if (searchKey != null && list != null && !list.isEmpty()) {
            for (int i = 0, size = list.size(); i < size; i++) {
                SearchAble searchAble = list.get(i);
                if (searchKey.equals(searchAble.getSearchKey())) {
                    return i;
                }
            }
        }
        return -1;
    }
} 